package com.meilai.project.entity.personal.mission;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.meilai.project.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * <p>
 *
 * </p>
 *
 * @author 张驰
 * @since 2022-03-24
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="Mission对象", description="任务")
public class Mission extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "任务标题")
    private String title;

    @ApiModelProperty(value = "任务描述")
    private String desp;

    @ApiModelProperty(value = "1紧急，2较紧急，3普通，4不紧急")
    private Integer emergency;

    @ApiModelProperty(value = "1重要，2较重要，3普通，4不重要")
    private Integer important;

    @ApiModelProperty(value = "截止时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime deadline;

    @ApiModelProperty(value = "开启提醒，0否，1是")
    private Integer use_tip;

    @ApiModelProperty(value = "首次提醒需要提前多少时间（分钟，经换算获得）")
    private Long prev_tip_gap;

    @ApiModelProperty(value = "首次提醒需要提前多少时间（填写的数字）")
    private Long prev_tip_gap_num;

    @ApiModelProperty(value = "首次提醒需要提前多少时间（单位）1分钟，2小时，3天")
    private Integer prev_tip_gap_unit;

    @ApiModelProperty(value = "开启持续提醒，0否，1是")
    private Integer use_continue_tip;

    @ApiModelProperty(value = "持续提醒间隔（分钟，经换算获得）")
    private Long continue_tip_gap;

    @ApiModelProperty(value = "持续提醒间隔（填写的数字）")
    private Long continue_tip_gap_num;

    @ApiModelProperty(value = "持续提醒间隔（单位）1分钟，2小时，3天")
    private Integer continue_tip_gap_unit;

    @ApiModelProperty(value = "任务状态，0关闭，1执行中，2完成")
    private Integer cur_status;

    @ApiModelProperty(value = "关闭时间（创建人手动关闭）")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private LocalDateTime off_at;

    @ApiModelProperty(value = "完成时间（全部执行人都完成/创建人手动完成）")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private LocalDateTime complete_at;

    @ApiModelProperty(value = "创建人id")
    private Long creator_id;

}
